#!/bin/sh -e

patch -p1 < libtheora-1.1.1-libpng16.patch
patch -p1 < fix-theoraenc.patch

./configure \
    --prefix=/usr

make
make -C lib     DESTDIR="$1" install
make -C include DESTDIR="$1" install
make            DESTDIR="$1" install-pkgconfigDATA
